/*
* Copyright 2024 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"



void setup_scr_get_passwd(lv_ui *ui)
{
    //Write codes get_passwd
    ui->get_passwd = lv_obj_create(NULL);
    lv_obj_set_size(ui->get_passwd, 480, 480);
    lv_obj_set_scrollbar_mode(ui->get_passwd, LV_SCROLLBAR_MODE_OFF);

    //Write style for get_passwd, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->get_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes get_passwd_label_passwd
    ui->get_passwd_label_passwd = lv_label_create(ui->get_passwd);
    lv_label_set_text(ui->get_passwd_label_passwd, "");
    lv_label_set_long_mode(ui->get_passwd_label_passwd, LV_LABEL_LONG_WRAP);
    lv_obj_set_pos(ui->get_passwd_label_passwd, 0, 32);
    lv_obj_set_size(ui->get_passwd_label_passwd, 480, 32);

    //Write style for get_passwd_label_passwd, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->get_passwd_label_passwd, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->get_passwd_label_passwd, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->get_passwd_label_passwd, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->get_passwd_label_passwd, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->get_passwd_label_passwd, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes get_passwd_cont_kb
    ui->get_passwd_cont_kb = lv_obj_create(ui->get_passwd);
    lv_obj_set_pos(ui->get_passwd_cont_kb, 0, 64);
    lv_obj_set_size(ui->get_passwd_cont_kb, 480, 416);
    lv_obj_set_scrollbar_mode(ui->get_passwd_cont_kb, LV_SCROLLBAR_MODE_OFF);

    //Write style for get_passwd_cont_kb, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_cont_kb, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(ui->get_passwd_cont_kb, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(ui->get_passwd_cont_kb, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_side(ui->get_passwd_cont_kb, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_cont_kb, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_cont_kb, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->get_passwd_cont_kb, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->get_passwd_cont_kb, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->get_passwd_cont_kb, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->get_passwd_cont_kb, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->get_passwd_cont_kb, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->get_passwd_cont_kb, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->get_passwd_cont_kb, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes get_passwd_btnm_upper
    ui->get_passwd_btnm_upper = lv_btnmatrix_create(ui->get_passwd_cont_kb);
    static const char *get_passwd_btnm_upper_text_map[] = {
        // 0 ~ 11
        "A", "B", "C", "D", "E", "F", "\n", "G", "H", "I", "J", "K", "L", "\n", 
        // 12 ~ 23
        "M", "N", "O", "P", "Q", "R", "\n", "S", "T", "U", "V", "W", "X", "\n", 
        // 24 ~ 35
        "Y", "Z", "!", "@", "#", "$", "\n", "%%", "^", "&", "*", "(", ")", "\n", 
        // 36 ~ 47
        "~", "_", "+", "{", "}", "|", "\n", ":", "\"", "<", ">", "?", "Aa", "\n",
        // 48 ~ 50
        "OK", "Cancel", "Del", "",};
    lv_btnmatrix_set_map(ui->get_passwd_btnm_upper, get_passwd_btnm_upper_text_map);
    lv_obj_set_pos(ui->get_passwd_btnm_upper, 0, 0);
    lv_obj_set_size(ui->get_passwd_btnm_upper, 480, 416);

    //Write style for get_passwd_btnm_upper, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_row(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_column(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_btnm_upper, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style for get_passwd_btnm_upper, Part: LV_PART_ITEMS, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_btnm_upper, 1, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(ui->get_passwd_btnm_upper, 255, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(ui->get_passwd_btnm_upper, lv_color_hex(0xc9c9c9), LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_border_side(ui->get_passwd_btnm_upper, LV_BORDER_SIDE_FULL, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->get_passwd_btnm_upper, lv_color_hex(0xffffff), LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->get_passwd_btnm_upper, &lv_font_montserratMedium_16, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->get_passwd_btnm_upper, 255, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_btnm_upper, 4, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_btnm_upper, 255, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->get_passwd_btnm_upper, lv_color_hex(0x2195f6), LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->get_passwd_btnm_upper, LV_GRAD_DIR_NONE, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->get_passwd_btnm_upper, 0, LV_PART_ITEMS|LV_STATE_DEFAULT);

    //Write codes get_passwd_btnm_lower
    ui->get_passwd_btnm_lower = lv_btnmatrix_create(ui->get_passwd_cont_kb);
    static const char *get_passwd_btnm_lower_text_map[] = {
        // 0 ~ 11
        "a", "b", "c", "d", "e", "f", "\n", "g", "h", "i", "j", "k", "l", "\n", 
        // 12 ~ 23
        "m", "n", "o", "p", "q", "r", "\n", "s", "t", "u", "v", "w", "x", "\n", 
        // 24 ~ 35
        "y", "z", "1", "2", "3", "4", "\n", "5", "6", "7", "8", "9", "0", "\n", 
        // 36 ~ 47
        "`", "-", "+", "[", "]", "\\", "\n", ";", "'", ",", ".", "/", "Aa", "\n",
        // 48 ~ 50
        "OK", "Cancel", "Del", "",};
    lv_btnmatrix_set_map(ui->get_passwd_btnm_lower, get_passwd_btnm_lower_text_map);
    lv_obj_set_pos(ui->get_passwd_btnm_lower, 0, 0);
    lv_obj_set_size(ui->get_passwd_btnm_lower, 480, 416);

    //Write style for get_passwd_btnm_lower, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_row(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_column(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_btnm_lower, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style for get_passwd_btnm_lower, Part: LV_PART_ITEMS, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_btnm_lower, 1, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(ui->get_passwd_btnm_lower, 255, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(ui->get_passwd_btnm_lower, lv_color_hex(0xc9c9c9), LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_border_side(ui->get_passwd_btnm_lower, LV_BORDER_SIDE_FULL, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->get_passwd_btnm_lower, lv_color_hex(0xffffff), LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->get_passwd_btnm_lower, &lv_font_montserratMedium_16, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->get_passwd_btnm_lower, 255, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_btnm_lower, 4, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_btnm_lower, 255, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->get_passwd_btnm_lower, lv_color_hex(0x2195f6), LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->get_passwd_btnm_lower, LV_GRAD_DIR_NONE, LV_PART_ITEMS|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->get_passwd_btnm_lower, 0, LV_PART_ITEMS|LV_STATE_DEFAULT);

    //Write codes get_passwd_label_wifi
    ui->get_passwd_label_wifi = lv_label_create(ui->get_passwd);
    lv_label_set_text(ui->get_passwd_label_wifi, "");
    lv_label_set_long_mode(ui->get_passwd_label_wifi, LV_LABEL_LONG_WRAP);
    lv_obj_set_pos(ui->get_passwd_label_wifi, 0, 0);
    lv_obj_set_size(ui->get_passwd_label_wifi, 480, 32);

    //Write style for get_passwd_label_wifi, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->get_passwd_label_wifi, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->get_passwd_label_wifi, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->get_passwd_label_wifi, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->get_passwd_label_wifi, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->get_passwd_label_wifi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //The custom code of get_passwd.


    //Update current screen layout.
    lv_obj_update_layout(ui->get_passwd);

    //Init events for screen.
    events_init_get_passwd(ui);
}
